﻿import request from '/@/utils/request';
enum Api {
  AddDeviceRelSlave = '/api/deviceRelSlave/add',
  DeleteDeviceRelSlave = '/api/deviceRelSlave/delete',
  UpdateDeviceRelSlave = '/api/deviceRelSlave/update',
  PageDeviceRelSlave = '/api/deviceRelSlave/page',
  DetailDeviceRelSlave = '/api/deviceRelSlave/detail',
  GetDeviceSlaveTemplateDeviceSlaveTemplateIdDropdown = '/api/deviceRelSlave/DeviceSlaveTemplateDeviceSlaveTemplateIdDropdown',
  GetDeviceInfoDeviceInfoIdDropdown = '/api/deviceRelSlave/DeviceInfoDeviceInfoIdDropdown',
}

// 增加从机通讯
export const addDeviceRelSlave = (params?: any) =>
	request({
		url: Api.AddDeviceRelSlave,
		method: 'post',
		data: params,
	});

// 删除从机通讯
export const deleteDeviceRelSlave = (params?: any) => 
	request({
			url: Api.DeleteDeviceRelSlave,
			method: 'post',
			data: params,
		});

// 编辑从机通讯
export const updateDeviceRelSlave = (params?: any) => 
	request({
			url: Api.UpdateDeviceRelSlave,
			method: 'post',
			data: params,
		});

// 分页查询从机通讯
export const pageDeviceRelSlave = (params?: any) => 
	request({
			url: Api.PageDeviceRelSlave,
			method: 'post',
			data: params,
		});

// 详情从机通讯
export const detailDeviceRelSlave = (id: any) => 
	request({
			url: Api.DetailDeviceRelSlave,
			method: 'get',
			data: { id },
		});

export const getDeviceSlaveTemplateDeviceSlaveTemplateIdDropdown = () =>
		request({
		url: Api.GetDeviceSlaveTemplateDeviceSlaveTemplateIdDropdown,
		method: 'get'
		});
export const getDeviceInfoDeviceInfoIdDropdown = () =>
		request({
		url: Api.GetDeviceInfoDeviceInfoIdDropdown,
		method: 'get'
		});

